using UnityEngine;

public abstract class Interactable : MonoBehaviour
{
    protected void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Bubble")) OnTouch();
    }

    protected void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Bubble")) WhenStay();
    }

    protected void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Bubble")) OnLeave();
    }

    public virtual void OnTouch() { }
    public virtual void WhenStay() { }
    public virtual void OnLeave() { }
}